package com.briup.cms.service.impl;

import com.briup.cms.bean.Config;
import com.briup.cms.dao.ConfigMapper;
import com.briup.cms.service.IConfigService;
import org.apache.ibatis.jdbc.Null;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ConfigServiceImpl implements IConfigService {
    @Resource
    private ConfigMapper configMapper;

    @Override
    public List<Config> findAll() { return configMapper.SelectAll(); }

    @Override
    public void saveOrUpdate(Config config) {
        if (config.getId()!= null)
            configMapper.update(config);
        else{
            configMapper.insert(config);
            }
    }
    @Override
    public void deleteById(long id) {configMapper.deleteById(id);

    }


}
